package com.huatai.datacenter.controller.datadesensitization;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.huatai.common.api.R;
import com.huatai.datacenter.entity.datadesensitization.DesensitizationApplyEntity;
import com.huatai.datacenter.service.DesensitizationApplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gusiyi
 * @version 1.0
 * @className MaskApplyController
 * @description 描述：
 * @date 2023/6/12 16:56
 */
@RestController
@Api(value = "脱敏脱密应用管理",tags = "脱敏脱密应用管理")
@RequestMapping("/desensitization/apply")
public class DesensitizationApplyController {

	@Autowired
	private DesensitizationApplyService desensitizationApplyService;

	@RequestMapping("/getList")
	@ApiOperation("获取脱敏脱密应用清册")
	@ApiOperationSupport(order = 1,includeParameters = {
		"desensitizationApplyEntity.desensitizationName",
		"desensitizationApplyEntity.pageIndex",
		"desensitizationApplyEntity.pageSize"
	})
	public R<Page<DesensitizationApplyEntity>> getDesensitizationApplyList(@RequestBody DesensitizationApplyEntity desensitizationApplyEntity){
		return R.data(desensitizationApplyService.getDesensitizationApplyList(desensitizationApplyEntity),"获取脱敏脱密应用清册成功");
	}

	@RequestMapping("/bindApply")
	@ApiOperation("绑定脱敏脱密应用")
	@ApiOperationSupport(order = 2,includeParameters = {
		"desensitizationApplyEntity.serviceId",
		"desensitizationApplyEntity.serviceName",
		"desensitizationApplyEntity.desensitizationId",
		"desensitizationApplyEntity.desensitizationName",
		"desensitizationApplyEntity.dataModelId",
		"desensitizationApplyEntity.dataModelName",
		"desensitizationApplyEntity.fieldName"
	})
	public R<DesensitizationApplyEntity> bindApply(@RequestBody DesensitizationApplyEntity desensitizationApplyEntity){
		return R.status(desensitizationApplyService.bindApply(desensitizationApplyEntity));
	}


}
